package com.zmx.utils;

import java.util.HashMap;

/**
 * 2020/10/19
 * 22:46
 * zmx
 */
public class RUtils extends HashMap<String,Object> {
    private static final long serialVersionUID = 1L;
    public RUtils(Integer code,String msg,Object data){
        this.put("code",code);
        this.put("msg",msg);
        this.put("data",data);
    }
    public static RUtils success(String msg,Object data){
        return new RUtils(0,msg,data);
    }
    public static RUtils fail(String msg,Object data){
        return new RUtils(1,msg,data);
    }
    // 连环put
    @Override
    public RUtils put(String key, Object value) {
        super.put(key,value);
        return this;
    }
}
